<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="common.jsp"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!-- 深圳宝田医院 -->
<!DOCTYPE html>
<html>
<head>
<title>呼叫</title>
<script src="${ctx}/jiaohao/amq_jquery_adapter.js"></script>
<script src="${ctx}/jiaohao/amq.js"></script>
<script src="${ctx}/jiaohao/jquery.json-2.2.js"></script>
<script type="text/javascript">
	
	var allList = [];
	var vac01Arr = [];
//消息推送
$(function () {
	var topic = $("#topic").val();
	$.ajax({
		url:rootUrl + "/clidoctor/selectDataByScriptId",
		type:'get',
		dataType:'json',
		async:false,
		data:{ ID:10000020, paramStr:'{triage_id:'+topic+'}'},
		success:function(data)
		{
			debugger;
			var bas1List = data.list;
			var html = "";
			for(var i=0;i<bas1List.length;i++)
			{
				var temp = bas1List[i];
				html+='<tr id="'+temp.bas01+'">';
				html+='<td>'+temp.bck03+'-'+temp.bas02+'</td>';
				html+='<td class="vad21"></td>';
				html+='<td class="vaa05"></td>';
				html+='<td class="bce03a"></td>';
				html+='<td>下一位</td>';
				html+='<td class="vad21_2"></td>';
				html+='<td class="vaa05_2"></td>';
			}
			$("#jiaohaoTr").html(html);
		}
	});
	var amq = org.activemq.Amq;  
	amq.init({   
	  uri: 'amq', 
	  logging: true,
	  timeout: 5
	}); 
	var myHandler = function (message) 
	{
		debugger;
		var html;
		$("#msgDiv").empty();
		$("#msgDiv").append(unescape(message.data.replace(/\u/g, "%u")).replace("\\",''));
		var msgData = JSON.parse(message.data);
		var obj = msgData.hJrow;
		var obj2 = msgData.hJrow2;
		$("#"+obj.bas01).find(".vad21").text(obj.vaa03);
		$("#"+obj.bas01).find(".vaa05").text(obj.vaa05);
		$("#"+obj.bas01).find(".bce03a").text(obj.bce03a);
		$("#"+obj.bas01).find(".vad21_2").text(obj2.vaa03?obj2.vaa03:"-");
		$("#"+obj.bas01).find(".vaa05_2").text(obj2.vaa05?obj2.vaa05:"-");
	}
	amq.addListener("smeguangdong","topic://"+topic,myHandler);
});

</script>
<link href="${ctx}/jiaohao/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<input type="hidden" id="topic" value="<%=request.getParameter("topic")%>"/>
	<div id="msgDiv" style="display: none;"></div>
	<div id="user" data-info=""></div>
	
    <div class="header">
      <div class="topleft">
      </div> 
         <div class="topcenter1"></div>
      
      <div class="topright">
        <span></span>
      </div>       
    </div>
    <!--顶部的结束-->
     <div class="formbody">
        <div class="maininfo">
           <table class="imgtable">
            <thead>
            <tr>
                <th width="5%" height="100"></th>
                <th width="2%">门诊号</th>
                <th width="2%">姓名</th>
                <th width="2%">医生</th>
                <th width="2%"></th>
                <th width="2%">门诊号</th>
                <th width="2%">姓名</th>
                <th width="2%"></th>
            </tr>
            </thead>
            <tbody id="jiaohaoTr"></tbody>
            </table>
        </div>
      </div>
   <!--中间区域结束-->
   <div class="footer">
     请在候诊厅等待就诊，保持安静，不要走开，祝您早日康复
   </div>
